<template>
    <div class="featureConf">
<!--      <el-card class="box-card">-->
<!--        <div slot="header" class="clearfix">暂离规则配置</div>-->
<!--        <div>超过 <el-input v-model="listData.away_exceed_time" size="mini"/>分钟没有回复玩家并且未读消息>=<el-input v-model="listData.away_unanswered" size="mini"/> 条自动切换为暂离状态，退出接线坐席，用户回复玩家后自动取消暂离，并回到接线坐席。-->
<!--        </div>-->
<!--      </el-card>-->
      <el-card class="box-card">
        <span>评价开关：</span>
        <el-switch
          @change="valChange"
          v-model="evaluationSwitch"
          active-color="#13ce66"
          inactive-color="#ff4949">
        </el-switch>
        <div></div>
      </el-card>
    </div>
</template>

<script>
  import { getUserOrderConfig ,setUserOrderConfig} from '@/api'
export default {
  data() {
    return {
      listData: {},
      evaluationSwitch:false
    }
  },
  activated(){
    this.getFeaturesConfig()
  },
  methods: {
    getFeaturesConfig(){
      getUserOrderConfig().then(res => {
        if(res.status === 0){
          this.evaluationSwitch = res.data.can_comment
        }
      })
    },
    valChange(val){
      setUserOrderConfig({can_comment:val}).then(res =>{
        if(res.status === 0){
          this.$message({
            message:`${val?'开启':'关闭'}成功`,
            type:'success'
          })
        }
      })
    }
  }
}
</script>

<style lang="scss">
.featureConf{
  .el-input{
    width: 100px;
  }
}
</style>
